package com.mlk.waste.utils;

import ch.qos.logback.core.net.SyslogOutputStream;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import com.mlk.core.constants.Constant;

import java.util.Date;

/**
 * 生成订单号码
 */
public class OrderCodeUtils {

    /**
     * 生成订单号码
     * @return
     */
    public static final String generate(){
        String prefix = DateUtil.format(new Date(), Constant.SIMPLE_DATE_FORMAT);
        Long suffix = IdUtil.createSnowflake(2L,3).nextId();
        return suffix.toString();
    }
}
